import Vue from 'vue'
import Router from 'vue-router'
import IndexPage from '../pages/basic'       //首页
import VueResource from 'vue-resource'
import DetailPage from '../pages/detail'    //购买页

import DetailAnaPage from '../pages/detail/analysis'       //流量分析
import DetailCouPage from '../pages/detail/count'       //数据统计
import DetailForPage from '../pages/detail/forecast'     //数据预测
import DetailPubPage from '../pages/detail/publish'    //产品发布
import OrderListPage from '../pages/OrderList'
Vue.use(Router)
Vue.use(VueResource)

export default new Router({
  mode: "history",
  routes: [
    {
      path: '/',
      component: IndexPage
    },
    {
      path: '/orderList',
      component: OrderListPage
    },
    {
        path:'/detail',
        component:DetailPage,
        redirect:'/detail/analysis', //所有访问节点的直接定位到此地址
        children:[
            {
                path:'analysis',
                component:DetailAnaPage
            },
            {
                path:'count',
                component:DetailCouPage
            },{
                path:'forecast',
                component:DetailForPage
            },{
                path:'publish',
                component:DetailPubPage
            }
        ]
    }
  ]
})
